Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix grep commands #12994

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Fix grep commands #12994

merged 1 commit into from
Feb 11, 2025

Conversation

jan-cerny
Copy link
Collaborator

Addressing:

harden_sshd_ciphers_opensshserver_conf_crypto_policy:

grep: [email protected],[email protected],aes256-ctr,aes128-ctr: invalid context length argument

harden_sshd_macs_opensshserver_conf_crypto_policy:

grep: invalid option -- 'M'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.

Related to: #12942

Addressing:

harden_sshd_ciphers_opensshserver_conf_crypto_policy:

grep: [email protected],[email protected],aes256-ctr,aes128-ctr: invalid context length argument

harden_sshd_macs_opensshserver_conf_crypto_policy:

grep: invalid option -- 'M'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.

Related to: ComplianceAsCode#12942
@jan-cerny jan-cerny added this to the 0.1.77 milestone Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_harden_sshd_ciphers_opensshserver_conf_crypto_policy' differs.
--- xccdf_org.ssgproject.content_rule_harden_sshd_ciphers_opensshserver_conf_crypto_policy
+++ xccdf_org.ssgproject.content_rule_harden_sshd_ciphers_opensshserver_conf_crypto_policy
@@ -11,7 +11,7 @@
 # Ensure CRYPTO_POLICY is not commented out
 sed -i 's/#CRYPTO_POLICY=/CRYPTO_POLICY=/' ${CONF_FILE}
 
-if ! grep -q "$correct_value" "$CONF_FILE"; then
+if ! grep -q "\\$correct_value" "$CONF_FILE"; then
     # We need to get the existing value, using PCRE to maintain same regex
     existing_value=$(grep -Po '(-oCiphers=\S+)' ${CONF_FILE})
 

bash remediation for rule 'xccdf_org.ssgproject.content_rule_harden_sshd_macs_opensshserver_conf_crypto_policy' differs.
--- xccdf_org.ssgproject.content_rule_harden_sshd_macs_opensshserver_conf_crypto_policy
+++ xccdf_org.ssgproject.content_rule_harden_sshd_macs_opensshserver_conf_crypto_policy
@@ -11,7 +11,7 @@
 # Ensure CRYPTO_POLICY is not commented out
 sed -i 's/#CRYPTO_POLICY=/CRYPTO_POLICY=/' ${CONF_FILE}
 
-if ! grep -q "$correct_value" "$CONF_FILE"; then
+if ! grep -q "\\$correct_value" "$CONF_FILE"; then
     # We need to get the existing value, using PCRE to maintain same regex
     existing_value=$(grep -Po '(-oMACs=\S+)' ${CONF_FILE})
 

Copy link

codeclimate bot commented Feb 7, 2025

Code Climate has analyzed commit 000366c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 61.9% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 self-assigned this Feb 10, 2025
@Mab879
Copy link
Member

Mab879 commented Feb 11, 2025

Waving Automatus as it is tests not found.

@Mab879 Mab879 merged commit fdbcf30 into ComplianceAsCode:master Feb 11, 2025
106 of 111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants